package com.tfswx.jkgl.core.yzfs;

import com.tfswx.jkgl.core.yzfs.base.YzfsBase;
import org.springframework.stereotype.Component;

/**
 * @author ricky
 * @date 2021/12/5
 */
@Component
public class Max implements YzfsBase {
    @Override
    public boolean isValid(Object value, Object yzz) {
        if (value == null) {
            return true;
        }
        double ysz = Double.parseDouble(String.valueOf(value));
        double old = Double.parseDouble(String.valueOf(yzz));
        return ysz <= old;
    }

    @Override
    public String getName() {
        return "最大值";
    }

    @Override
    public boolean sfxycs() {
        return true;
    }

    @Override
    public String getMessage() {
        return "不能大于规定值";
    }

    @Override
    public String getYzzValue(String yzz) {
        return yzz;
    }
}
